package com.yupi.project.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.yupi.yuapicommon.model.dto.interfaceinfo.InvokeRequest;
import com.yupi.yuapicommon.model.entity.InterfaceInfo;
import com.yupi.yuapicommon.model.entity.InterfaceInvokeInfo;
import com.zzsource.yuapicliensdk.model.response.ResultResponse;

import javax.servlet.http.HttpServletRequest;


/**
* @author 12822
* @description 针对表【interface_info(接口信息)】的数据库操作Service
* @createDate 2023-01-06 23:51:28
*/
public interface InterfaceInfoService extends IService<InterfaceInfo> {
    /**
     * 校验
     *
     * @param interfaceInfo
     * @param add 是否为创建校验
     */
    void validInterfaceInfo(InterfaceInfo interfaceInfo, boolean add);

    /**
     * 异步执行接口调用任务
     * @param invokeRequest
     * @param request
     * @return
     */
    InterfaceInvokeInfo invokeAsync(InvokeRequest invokeRequest, HttpServletRequest request);

    /**
     * 同步执行接口调用任务
     * @param invokeRequest
     * @param request
     * @return
     */
    ResultResponse invokeSync(InvokeRequest invokeRequest, HttpServletRequest request);
}
